SRC = $(wildcard *.s)
OBJ = $(SRC:%.s=%.o) 
BIN = $(OBJ:%.o=%)

AS = as
CC = ld

LDFLAGS = -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -lc
ASFLAGS = --32 -g

clean : 
	rm $(OBJ)
cleanall : 
	rm $(BIN) $(OBJ)
scastest2.o : scastest2.s
	$(AS) $(ASFLAGS) -o $@ $<
strcomp.o : strcomp.s
reptest1.o : reptest1.s
cmpstest2.o : cmpstest2.s
scastest1.o : scastest1.s
reptest4.o : reptest4.s
movstest3.o : movstest3.s
cmpstest1.o : cmpstest1.s
convert.o : convert.s
strsize.o : strsize.s
reptest2.o : reptest2.s
stostest1.o : stostest1.s
movstest1.o : movstest1.s
movstest2.o : movstest2.s
reptest3.o : reptest3.s

scastest2 : scastest2.o
	$(CC) $(LDFLAGS) -o $@ $<
strcomp : strcomp.o
reptest1 : reptest1.o
cmpstest2 : cmpstest2.o
scastest1 : scastest1.o
reptest4 : reptest4.o
movstest3 : movstest3.o
cmpstest1 : cmpstest1.o
convert : convert.o
strsize : strsize.o
reptest2 : reptest2.o
stostest1 : stostest1.o
movstest1 : movstest1.o
movstest2 : movstest2.o
reptest3 : reptest3.o
all : scastest2 strcomp reptest1 cmpstest2 scastest1 reptest4 movstest3 cmpstest1 convert strsize reptest2 stostest1 movstest1 movstest2 reptest3 clean
